﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<noscript>
    <div style=" position:absolute; z-index:100000; height:2046px;top:0px;left:0px; width:100%; background:white; text-align:center;">
        <img src="~/Content/easyui/themes/icons/no.png" alt='抱歉，请开启脚本支持！' />
    </div>
</noscript>
<div region="north" split="true" border="false" style="overflow: hidden; height: 40px;
        background: #7f99be repeat-x center 50%;
        line-height: 40px;color: #fff; font-family: Verdana, 微软雅黑,黑体">
    <span style="float:right; padding-right:20px;" class="head">欢迎 管理员 <a href="javascript:openPwd();" id="editpass">修改密码</a> <a href="#" id="loginOut">安全退出</a></span>
    <span style="padding-left:15px; font-size: 24px; "><img src="~/Content/images/green.png" width="30" height="30" align="absmiddle" /> 自助考核系统题库管理</span>
</div>
<div region="south" split="true" style="height: 30px; background: #D2E0F2; ">
    <div class="footer">&copy; 2015 自助考核系统</div>
</div>
<div region="west" hide="true" split="true" title="导航菜单" style="width:180px;" id="west">
    <div id="nav" class="easyui-accordion" fit="true" border="false">
        <!--  导航内容 -->
    </div>
</div>
<div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden">
    <div id="tabs" class="easyui-tabs" fit="true" border="false">
        <div title="欢迎使用" style="padding:20px;overflow:hidden; color:red; ">
        </div>
    </div>
</div>
<!--修改密码窗口-->
<div id="pwdDialog" class="easyui-dialog" style="width:320px;height:200px;padding:10px 20px"
     closed="true" resizable="true" modal="true" buttons="#dlg-buttons" align="center">
    <form id="ff" method="post" novalidate="novalidate">
        <table id="tblAdd">
            <tr>
                <td>旧密码：</td>
                <td><input id="oldPwd" type="Password" class="txt01" /></td>
            </tr>
            <tr>
                <td>新密码：</td>
                <td><input id="txtNewPass" type="Password" class="txt01" /></td>
            </tr>
            <tr>
                <td>确认密码：</td>
                <td><input id="txtRePass" type="Password" class="txt01" /></td>
            </tr>
            <tr>
                <td colspan="2" style="text-align:center; padding-top:10px">
                    
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="btnEp" iconcls="icon-ok">确定</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript: $('#pwdDialog').dialog('close')">关闭</a>
                </td>
            </tr>
        </table>
    </form>
</div>
@*<div id="mm" class="easyui-menu" style="width:150px;">
        <div id="mm-tabupdate">刷新</div>
        <div class="menu-sep"></div>
        <div id="mm-tabclose">关闭</div>
    </div>*@
<script type="text/javascript">
    var _menus = {
        "menus": [
             {
                 "menuid": "1", "icon": "icon-mail", "menuname": "题库设置",
                 "menus": [
                         { "menuid": "12", "menuname": "题库管理", "icon": "icon-noprocess", "url": "/Manage/QuestionManage" }
                 ]
             }
        ]
    };
    //设置登录窗口
    function openPwd() {
        $('#pwdDialog').dialog('open').dialog('setTitle', '修改密码');
    }

    //修改密码
    function modifyPwd() {
        var $newpass = $('#txtNewPass');
        var $rePass = $('#txtRePass');

        if ($newpass.val() == '') {
            $.messager.alert('系统提示', '请输入密码！', 'warning');
            return false;
        }
        if ($rePass.val() == '') {
            $.messager.alert('系统提示', '请在一次输入密码！', 'warning');
            return false;
        }

        if ($newpass.val() != $rePass.val()) {
            $.messager.alert('系统提示', '两次密码不一至！请重新输入', 'warning');
            return false;
        }

        $.post('UpdatePwd', { oldPwd: $("#oldPwd").val(), newPwd: $('#txtRePass').val() }, function (msg) {
            if (msg.ResultType == "Success")
                location.href = "LoginOut";
            else {
                $.messager.alert('提示', msg.Message, "error");
            }
        })

    }

    $(function () {

        $('#btnEp').click(function () {
            modifyPwd();
        })

        $('#btnCancel').click(function () { closePwd(); })

        $('#loginOut').click(function () {
            $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {

                if (r) {
                    location.href = 'LoginOut';
                }
            });
        })

        InitLeftMenu();
    });



</script>